<HTML>
<CENTER><A HREF = "http://pizza.sandia.gov">Pizza.py WWW Site</A> - <A HREF = "Manual.html">Pizza.py Documentation</A> - <A HREF = "Section_tools.html">Pizza.py Tools</A> 
</CENTER>






<HR>

<H3>bdump tool 
</H3>
<P><B>Purpose:</B>
</P>
<P>Read dump files with bond info.
</P>
<P><B>Description:</B>
</P>
<P>The bdump tool reads one or more LAMMPS dump files, and stores their
contents as a series of snapshots with 2d arrays of atom attributes.
It is assumed that each entry contains info for a bond in a LAMMPS
simulation as is typically written by the dump local command in
LAMMPS.  Other tools use bdump objects to extract bond info for
visualization, like the dump tool via its extra() method.
</P>
<P>The constructor method is passed a string containing one or more dump
filenames.  They can be listed in any order since snapshots are sorted
by timestep after they are read and duplicate snapshots (with the same
time stamp) are deleted.  If a 2nd argument is specified, the files
are not immediately read, but snapshots can be read one-at-a-time by
the next() method.
</P>
<P>The map() method assigns names to columns of attributes.  The
id,type,atom1,atom2 names must be assigned in order for bond info to
be extracted.
</P>
<P>The viz() method is called by Pizza.py tools that visualize snapshots
of atoms (e.g. gl, raster, svg tools).
</P>
<HR>

<P>Normally, <A HREF = "http://lammps.sandia.gov">LAMMPS</A> creates the dump files
read in by this tool. If you want to create them yourself, the format
of LAMMPS dump local files is simple.  Each snapshot is formatted as
follows:
</P>
<PRE>ITEM: TIMESTEP
100
ITEM: NUMBER OF ENTRIES
32
ITEM: ENTRIES
1 1 5 10
2 1 11 45
3 2 6 8
...
N -3 23 456 
</PRE>
<P>There are N lines following "ITEM: ENTRIES" where N is the number of
entries.  Entries do not have to be listed in any particular order.
There can be a different number of entries in each snapshot.  Each
line must contain the bond ID, type, and the 2 atom IDs of the atoms
in the bond, as specified by the map() command.
</P>
<HR>

<P><B>Usage:</B>
</P>
<PRE>b = bdump("dump.one")             read in one or more dump files
b = bdump("dump.1 dump.2.gz")	  can be gzipped
b = bdump("dump.*")		  wildcard expands to multiple files
b = bdump("dump.*",0)		  two args = store filenames, but don't read 
</PRE>
<PRE>  incomplete and duplicate snapshots are deleted
  no column name assignment is performed 
</PRE>
<PRE>time = b.next()             	  read next snapshot from dump files 
</PRE>
<PRE>  used with 2-argument constructor to allow reading snapshots one-at-a-time
  snapshot will be skipped only if another snapshot has same time stamp
  return time stamp of snapshot read
  return -1 if no snapshots left or last snapshot is incomplete
  no column name assignment is performed 
</PRE>
<PRE>b.map(1,"id",3,"x")               assign names to atom columns (1-N) 
</PRE>
<PRE>  must assign id,type,atom1,atom2 
</PRE>
<PRE>time,box,atoms,bonds,tris,lines = b.viz(index)   return list of viz objects 
</PRE>
<PRE>  viz() returns line info for specified timestep index
    can also call as viz(time,1) and will find index of preceding snapshot
    time = timestep value
    box = NULL
    atoms = NULL
    bonds = id,type,atom1,atom2 for each line as 2d array
    tris = NULL
    lines = NULL 
</PRE>
<P><B>Related tools:</B>
</P>
<P><A HREF = "dump.html">dump</A>, <A HREF = "gl.html">gl</A>, <A HREF = "raster.html">raster</A>, <A HREF = "svg.html">svg</A>
</P>
<P><B>Prerequisites:</B>
</P>
<P>Numeric or NumPy Python packages.  Gunzip command (if you want to read
gzipped files).
</P>
</HTML>
